<?php
//dezend by http://www.yunlu99.com/ QQ:270656184
defined('BASEPATH') || exit('No direct script access allowed');
$this->load->helper('url');
?><link rel="stylesheet" type="text/css" href="/static/css/upload.css">
<form id="ff" method="post" style="margin:10px 0px 0px 10px;display:block;">
	<input type="hidden" name="id" value="<?php echo $id;?>">
	<table style="font-size:12px;" cellspacing="5">
		<tr>
			<td>文章标题</td>
			<td><input type="text" class="easyui-validatebox" name="title" value="<?php echo $title;?>" required="true"></td>
		</tr>
		<tr>
			<td>英文标题</td>
			<td><input type="text" class="easyui-validatebox" name="en_title" value="<?php echo $en_title;?>" required="true"></td>
		</tr>
		<tr>
			<td>文章简介</td>
			<td><input type="text" class="easyui-validatebox" name="short_title" value="<?php echo $short_title;?>" required="true"></td>
		</tr>
		<tr>
			<td>所属分类</td>
			<td>
			<input class="easyui-combobox" style="width:156px;"
							name="cid"
							data-options="
									url:'<?php echo site_url('article/selectdata/' . $cid);?>',
									method:'get',
									valueField:'id',
									textField:'text',
									panelHeight:'auto'
							">
			</td>
		</tr>
		<tr>
			<td>排序</td>
			<td><input type="text" class="easyui-validatebox" name="sort" value="<?php echo $sort;?>"></td>
		</tr>
		<tr>
			<td>内容</td>
			<td><textarea name="content" cols=30 rows=15><?php echo $content;?></textarea></td>
		</tr>
		<tr>
			<td>英文内容</td>
			<td><textarea name="en_content" cols=30 rows=15><?php echo $en_content;?></textarea></td>
		</tr>
		<tr>
			<td>是否显示</td>
			<td>
				<input type="radio" name="status" value="0" 
<?php
if ($status == 0) {
?>checked<?php
}

?>>否 
				<input type="radio" name="status" value="1" 
<?php
if ($status == 1) {
?>checked<?php
}

?>>是
			</td>
		</tr>
		<tr>
			<td></td>
			<td>
			<button type="submit" class="easyui-linkbutton" iconCls="icon-ok">提交</button>
			</td>
		</tr>
	</table>
</form>

<link rel="stylesheet" href="/static/plugin/kindeditor/themes/default/default.css" />
<script charset="utf-8" src="/static/plugin/kindeditor/kindeditor-min.js"></script>
<script charset="utf-8" src="/static/plugin/kindeditor/lang/zh_CN.js"></script>

<script language="javascript">
$(function(){
	KindEditor.create('[name="content"],[name="en_content"]', {
		resizeArt : 1,
		allowPreviewEmoticons : false,
		allowImageUpload : true,
		afterBlur: function(){this.sync();},
		items : [
			'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
			'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
			'insertunorderedlist', '|', 'image', 'link']
	});
	
	$('#ff').form({
		url:'<?php echo site_url('article/update');?>',
		onSubmit:function(){
			return $(this).form('validate');
		},
		success:function(data){
			data = eval('('+data+')');
			$.messager.alert('信息提示',data.msg,'info');
			if(data.error == 0){
				$('#win').window('close');
				$('#tt').datagrid('reload');
			}
		}
	});
});
</script>